<?php if(isset($data)&&isset($data['id'])&&$data['id']>0): ?>
<?php
$type = (isset($_GET)&&isset($_GET['modele'])&&$_GET['modele']!='')?$_GET['modele']:'publication';
?>
<br/><br/>
<h3>Galerie :</h3>
<div align="center">
<?php
$pl = 'galerie-'.$type.'-'.$data['id'].modele_permalien::getExtensionByModele('galerie');
$galerie = modele_galerie::findByPermalien($pl,'galerie');
?>
<?php if($galerie!==null): ?>
    <ul style="list-style: none; padding: 0; margin: 5px 0;">
    <?php foreach($galerie->getMedias() as $mediaG): ?>
        <li style="display: inline-block; margin: 3px;"><img width="45" src="<?php echo $mediaG->getUrl('../');?>" /></li>
    <?php endforeach; ?>
    </ul>
<a class="pwe-ui-btn" href="?template=galerie&modele=galerie&action=create&modele_id=<?php echo $galerie->getId(); ?>&pl=<?php echo $pl; ?>">Modifier</a>
<?php else: ?>
<a class="pwe-ui-btn" href="?template=galerie&modele=galerie&action=update&modele_id=0&pl=<?php echo $pl; ?>">Créer</a>
<?php endif; ?>
</div>
<?php endif; ?>